home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / misc / mouse_ta.z / mouse_ta / mouse / mouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-11  |  2.5 KB  |  80 lines

  1.  
  2. /*
  3.  * SYS V/386 dependent includes
  4.  */
  5. #include    <stdio.h>
  6. #include    <fcntl.h>
  7. #include    <ctype.h>
  8. #include    <sys/types.h>
  9. #include    <sys/ioctl.h>
  10. #include    <sys/param.h>
  11. #include    <time.h>
  12. #include    <termio.h>
  13. #include    <string.h>
  14. #include    <errno.h>
  15. #include    <signal.h>
  16. #include    "compiler.h"
  17. extern int errno;
  18.  
  19. #define DEVICE_INIT    0
  20. #define DEVICE_CLOSE    1
  21. #define DEVICE_ON    2
  22. #define DEVICE_OFF    3
  23.  
  24. /* 
  25.  * structure common for every Mouse
  26.   X386DeviceRec device;
  27.  */
  28. typedef struct {
  29.   int        Fd;
  30.   int           x,y,buttons;          /* internal state of this mouse */
  31.   int           threshold, num, den;  /* acceleration */
  32.   int           nobuttons;            /* button number */
  33.   int           packages;             /* packages / sec */
  34.   int           baudrate;             /* targeted speed */
  35.   int           protocol;             /* which way of data transmitting */
  36.   int           cflag;                /* default setting for protocol */
  37.   struct termio tty;                  /* termio struct of device */
  38.   unchar        hd_mask, hd_id;       /* identification of the first byte */
  39.   unchar        dp_mask, dp_id;       /* identification of a data byte */
  40.   int           nobytes;              /* package length */
  41.   unchar        sbuf[4];              /* state buffer for logitech */
  42.   int           emulate;              /* automata state for 2 button mode */
  43.   int           bufp;                 /* package buffer */
  44.   unchar        buf[8];
  45. } X386MouseRec, *X386MousePtr;
  46.  
  47. #define P_MS    0                     /* Microsoft */
  48. #define P_MSC   1                     /* Mouse Systems Corp */
  49. #define P_MM    2                     /* MMseries */
  50. #define P_LOGI  3                     /* Logitech */
  51. #define P_BM    4                     /* BusMouse ??? */
  52.  
  53. typedef int Bool;
  54.  
  55. typedef struct {
  56.   /* pointer part */
  57.   int           mseFd;
  58.   char          *mseDevice;
  59.   int           mseType;
  60.   int           baudRate;
  61.   int           sampleRate;
  62.   int           lastButtons;
  63.   int           threshold, num, den;  /* acceleration */
  64.   int           emulateState;         /* automata state for 2 button mode */
  65.   Bool          emulate3Buttons;
  66.  
  67. } x386InfoRec, *x386InfoPtr;
  68.  
  69. x386InfoRec x386Info;
  70.  
  71. #define P_MS    0                     /* Microsoft */
  72. #define P_MSC   1                     /* Mouse Systems Corp */
  73. #define P_MM    2                     /* MMseries */
  74. #define P_LOGI  3                     /* Logitech */
  75. #define P_BM    4                     /* BusMouse ??? */
  76.  
  77. #define Success    0
  78. #define TRUE    1
  79. #define FALSE    0
  80.